import React from 'react'
import "./index.less"
import icon from '@/assets/images/home/subject.png'
import { Button, LinearProgress } from '@mui/material'
import { useNavigate } from 'react-router-dom';

interface IProp {
    data: ISubjects;
}

export default function SubjectsItem({ data }: IProp) {
    const nav = useNavigate()
    return (
        <div className='item'>
            <div className="icon">
                <img src={icon} alt="" />
            </div>
            <div className='mid'>
                <h4>{data.title}</h4>
                <p>0/{data.itemCount}题</p>
                <LinearProgress variant="determinate" value={0} />
            </div>
            <div>
                <Button onClick={() => nav('/select/' + data.actionCode)} variant="contained">练习</Button>
            </div>
        </div>
    )
}
